//
//  MovieCollectionViewCell.m
//  UI_元旦豆瓣半完整版
//
//  Created by dllo on 16/1/7.
//  Copyright © 2016年 lanou3g. All rights reserved.
//

#import "MovieCollectionViewCell.h"

@implementation MovieCollectionViewCell

- (void)dealloc {
    [_movieImage release];
    [_nameLable release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self creatSubviews];
    }
    return self;
}

- (void)creatSubviews {
    
    self.movieImage = [[UIImageView alloc] init];
    [self.contentView addSubview:_movieImage];
    [_movieImage release];
    
    self.nameLable = [[UILabel alloc] init];
    [self.contentView addSubview:_nameLable];
    [_nameLable release];
    
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    _movieImage.frame = CGRectMake(0, 0, layoutAttributes.frame.size.width, layoutAttributes.frame.size.height - 30);
    _movieImage.backgroundColor = [UIColor clearColor];
    
    _nameLable.frame = CGRectMake(0, layoutAttributes.frame.size.height - 30, layoutAttributes.frame.size.width, 30);
    _nameLable.backgroundColor = [UIColor clearColor];
    _nameLable.textAlignment = NSTextAlignmentCenter;
}

@end
